# -*- coding: utf-8 -*-

from scrapy.spider import Spider
from lagou_scrapy.items import LagouScrapyItem


class DmozSpider(Spider):
    name = "lagou"
    allow_domains = ['lagou.com']
    start_urls = ["http://www.lagou.com/"]

    def parse(self, response):
        jas = response.selector.xpath('//div[@class="menu_sub dn"]/dl/dd/a/text()')
        items = []

        for a in jas:
            item = LagouScrapyItem()
            item['name'] = a.extract()
            items.append(item)
            print(item['name'])
        return items
